 {extend name="Public:base" /} 
                   {block name="seo"}
         <title>{$info.title}|{$info.tidname}|{$Think.CONFIG.WEB_SITE_TITLE} - Powered by EasySNS!</title>
  
  
  <meta name="keywords" content="{$Think.CONFIG.WEB_SITE_KEYWORD}">
  <meta name="description" content="{$Think.CONFIG.WEB_SITE_DESCRIPTION}">
      {/block}
 
 {block name="css"}
<style>
.container {
	min-width: 980px;
	max-width: 1200px;
	width: 100%;
}

html, body {
	background: #FCFCFC;
}
</style>
<link rel="stylesheet" type="text/css" href="__CSS__/doccon.css" />

{/block} {block name="extenddiv"} {/block} {block name="extenddivend"}

{/block} {block name="body"}
<div class="container"  style="margin-bottom:50px;">
	<div class="bread">
		<ul>
  <li><a href="{:url('index/index')}">{$Think.config.WEB_SITE_TITLE}</a></li>
  
        <i class="fa  fa-angle-right"></i>
        <li ><a href="{:url('doc/doclist',array('zoneid'=>$info.gid,'cid'=>$info.tid))}">{$info.tidname}</a></li>
  
  <i class="fa  fa-angle-right"></i>
    
        <li class="current">{$info.title}</li>
		</ul>
	</div>
	








		
	

		<div id="doc" class="page" style="width: auto;">
			
			<div id="bd">
				<div class="bd-wrap" style="min-width: 1200px;">



					<div class="body body-v3" style="width: 1200px;" >


						<div class="main">


							
							<div class="mod doc-main " id="doc-main" style="width: 964px;">
								
								<div class="inner">

									<div id="doc-header-test" class="hd doc-header no-doc-desc">
										
										<h1 class="reader_ab_test with-top-banner">
											<b class="ic ic-{$info.ext|strtolower}"></b><span id="doc-tittle-0">{$info.title}</span>
										</h1>
										<p class="doc-value" style="overflow: visible;">
											<span class="author"> <span class="ic ic-user"></span>
												<a target="_blank" class="user log-xsend "
												 href="{:url('user/home',array('id'=>$info.uid))}">{$info.nickname}
											</a> 上传于<em class="date">{$info.create_time|friendlyDate}</em>
											</span><i>|</i><span id="doc-info-0"><b class="bannerScore"></b><span
												class="normal-quality">{$info['raty']}分</span><span>(高于<span
													class="high-quality">{$bfb}</span>%的文档)
											</span><i>|</i><span class="ic ic-read-num"></span>{$info.view}<i>|</i><span
												class="ic ic-down-num"></span>{$info.down}</span> 
					
										</p>
										<div class="doc-desc-wrap" style="width: 964px;">
										{$info.description}
										</div>
										<hr>
									</div>
									
									
									<div class="bd doc-reader" style="position: relative">
										<span class="ico-wkmember-free-doc"> 
										<a href="#" target="_blank"></a>
										</span> 
										<span class="high-quality-doc"> <a href="javascript:;"></a>
										</span> 
										<span class="new-ico-wkmember-free-doc"	style="">
											<a href="javascript:;"></a>
										</span> 
										<span class="pay-doc-discount-ico"> 
										<a href="javascript:;"></a>
										</span>

										<div class="reader-container" id="reader-container-1"		>
											
											{if condition="$info['pageid'] gt 0"}
											<div class="reader-container-inner" id="reader-container-inner-1">
<style>
#reader-container-inner-1 .stl_02 img{width:100%;}
#reader-container-inner-1 .stl_02{margin: 0 0 6px;
    background-color: #fff;
width: 100%;

    overflow: hidden;
    border: 1px solid #D3D3D3;}
    #reader-container-inner-1 .stl_nopage{margin: 0 0 6px;
    background-color: #fff;
width: 100%;

    overflow: hidden;
    border: 1px solid #D3D3D3;}
    
@media screen and (min-device-pixel-ratio:0), (-webkit-min-device-pixel-ratio:0), (min--moz-device-pixel-ratio: 0) { .layer { } }
  .stl_02 span{font-family:"Times New Roman";}
    
</style>
<script>

function svgonload(obj){
	
//	var doc=obj.getSVGDocument();
	var width=$('#reader-container-inner-1').width();
	
	
  //  var height1=$(doc).find('svg').height();
    
    var width1=$(obj).width();
    var height1=$(obj).height();
    // var str='0,0,'+width+','+height;
   
   
	
	var duibi=parseFloat(width)/parseFloat(width1);

     $(obj).css({'width':duibi*width1,'height':duibi*height1});
     
     var height=$(obj).closest('.stl_02').outerHeight();
     $(obj).closest('.stl_02').find('.stl_view').css({'font-size':duibi*10+'em'});
     $(obj).closest('.stl_02').css('height',duibi*height1);


	



}
</script>




                                             </div>
											{/if}
											
											
											
											
											
											<div class="reader-container-inner hide"		id="shengtishi">
												<div id="html-reader-go-more"
													class="banner-wrap more-btn-banner" style="height: 423px;">
													<p class="banner-more-title">下载文档到电脑，方便使用</p>
													<p class="banner-more-info">
														<b class="iconDown"></b> <span>{if condition="$info['score'] gt 0"}{$info['score']}{$pointname}{else/}免费{/if}</span>&nbsp;&nbsp;<b
															class="bannerScore"></b><span class="normal-quality">{$info['raty']}分</span><span>(高于<span
															class="high-quality">{$bfb}</span>%的文档)
														</span>
													</p>
													<p>
														<a href="javascript:;" onclick="downtip();" id="download-btn"
																	class="btn btn-success" style="font-size:18px;">下载
																</a>
													</p>
													<div class="banner-more-btn">
														<span class="moreBtn goBtn"> <span>还剩<span id="shengpage"></span>页未读，</span><span
															class="fc2e">请下载</span>
														</span>
													</div>
												
													<div class="hengxian"></div>
									
													
												</div>
                                           </div>
											

											<div class="mod pay-page-mod complex hidden-doc-banner" id="endtishi">
												<b class="top"><b class="tl"></b><b class="tr"></b></b>
												<div class="inner">

													<div class="bd" id="bottom-download" >
														<div
															class="pay-page-inner reader-end-download reader-end-download-B"
															style="margin-top: 67px; width: 420px">
																{if condition="$info['pageid'] gt 0"}<p>阅读已结束，下载文档到电脑</p>{else /}
																<p>该文档无法预览，可下载到电脑后查看</p>
																{/if}
															<p class="banner-more-info footer-more-info">
																<b class="iconDown"></b> <span>{if condition="$info['score'] gt 0"}{$info['score']}{$pointname}{else/}免费{/if}</span>&nbsp;&nbsp;<b
																	class="bannerScore"></b><span class="normal-quality">{$info['raty']}分</span><span>(高于<span
																	class="high-quality">{$bfb}</span>%的文档)
																</span>
															</p>
															<div class="btn-download">
																<a href="javascript:;" onclick="downtip();" id=""
																	class="btn btn-success" style="font-size:18px;">下载
																</a>
															</div>
						
															
														</div>
													</div>
												</div>
												<b class="bottom"><b class="bl"></b><b class="br"></b></b>
											</div>

										

											{if condition="$info['pageid'] gt 0"}
											<a class="ic reader-fullScreen xllDownloadLayerHit_left top-right-fullScreen" href="javascript:;"  onclick="fulldoc();" title="全屏显示" ></a>
											{/if}
										</div>
					
								



										<div class="new-fc-container"></div>


									</div>
									<div class="ft">
									
										
										<div class="mod bottom-doc-list es-margin-t-20 hide" id="bottom-doc-list-3"
											style="display: block;">

											<div class="hd">
												<h4>你可能喜欢</h4>
											</div>
											<div class="bd">
												
												<div class="tabContent tableList data c-gray9">






													<table class="current">
														<tbody alog-group="view.strurecom.doc">

															<tr>
																<td class="txtL doc-title"><b class="ic ic-rtf"></b>
																<a href="#" target="_blank"  title="数据结构C语言模拟试题及答案没印">数据结构C语言模拟试题及答案没印</a></td>
																<td class="txtL doc-value">暂无评价</td>
																<td class="txtL doc-page-num">25页</td>
																<td class="txtL doc-price">免费</td>
															</tr>

															

														</tbody>
														<tfoot>
															<tr>
																<td class="list-more" colspan="4">
																<a href="#" target="_blank" >更多与“<span>数据结构试题及答案</span>”相关的内容&gt;&gt;
																</a></td>
															</tr>
														</tfoot>
													</table>





												</div>
											</div>
										</div>
										<div id="doc-comment" class="doc-comment">
											{if condition="session('member_info') neq null"}
											<h4>
												您的评论
											</h4>
											<div class="post-comment-wrap clearfix">
											<form id="commentform" data-url="{:url('comment/addcomment')}">
												<div class="add-ct-tip">
													<div class="add-ct-wrap">
														<p style="padding: 10px;">
															<textarea class="post-comment-ipt"	placeholder="写点评论支持下文档贡献者~" name="content"></textarea>
															<input type="hidden" name="fid" value="{$info.id}" />
															<input type="hidden" name="tid" id="commenttid" value="0" />
														</p>
														<p class="length-tip">最多支持240字留言</p>
													</div>
													<a class="add-new-btn btn btn-default"	href="javascript:void(0);">发布评论</a>
												
													<p class="tip"></p>
												</div>
												</form>
											</div>
											{/if}
											<div class="comment-wrap">
												<h4>
													用户评价<span class="ct-num">({$commentcount})</span>
												</h4>
												
												<ul class="comment-list " id="comment-list"	style="display: block;">

                                           {volist name="commentlist" id="vo"}	
                                                    <li class="ct-item ct-reply-unfold" id="item-4972730" style="height: auto;">
														<div class="ct-item-wrap">
															<div class="clearfix ct-con-wrap">
																<div class="ct-extra-into">
																	<p>{$vo.create_time|friendlyDate}</p>
																	<p>

																		<a href="javascript:void(0);" class="reply-btn " data-id="{$vo.id}" data-name="{$vo.nickname}">回复
																			(<span class="ry-num">{$vo.reply}</span>)
																		</a>
																	</p>
																</div>

																<div class="ct-con">
																	<div class="avatar-wrap">
																		<div>
																			<a href="{:url('user/home',array('id'=>$vo.uid))}" target="_blank">
																			<img 	class="avatar" src="{$vo.userhead|getheadurl}"></a>
																		</div>
																	</div>
																	<div class="main-con">
																		<p>
						
																			
																			{if condition="$vo['ratyscore'] gt 0"}
																			<span class="ct-star">
																			{php}$arr=getpingfen($vo['ratyscore']);{/php}
																		
																			{volist name="arr" id="subvo"}
																			{if condition="$subvo eq 2"}
																			<b class="ic-star-score star-score-on"></b>
																			{elseif condition="$subvo eq 1"}
																			<b class="ic-star-score star-score-half"></b>
																			{else/}
																			<b class="ic-star-score star-score-off"></b>
																			{/if}
																			{/volist}
																			
																			</span>
																			{else/}
																			
																			{/if}
																			
																			
																			
																			<a class="uname" href="{:url('user/home',array('id'=>$vo.uid))}"
																				target="_blank">{$vo.nickname}</a>


																		</p>
																		<div class="ct-atc">
																			<p>{$vo.content}</p>
																		</div>
																	</div>
																</div>
															</div>

								
														</div>
													</li>
                                                {/volist}

												</ul>
											</div>
										</div>
										<div id="pager">
											<div class="ui-pager pager-center">
												<div class="pager">
													<div class="pager-inner">
													{$commentlist->render()}</div>
												</div>
											</div>
										</div>
									
										<div id="ggbtm" style="width: 964px;">
											<div id="cpro_u2280094">
											
											</div>
											
										</div>
									</div>
								</div>
								
							</div>

							<div class="ys-ads-mask"></div>

						</div>


						<div class="aside aside-v3" style="display: block;">

							<div class="aside-wrap ">
								<div class="doc-upload  no-doc-desc" id="doc-upload" >
									<a class="btn btn-warning btn-block"  href="{:url('doc/docupload')}" style="font-size:20px;">
<i class="iconfont icon-upload " style="font-size:26px;"></i> 上传我的文档</a>
								</div>
								<div class="doc-aside-border" id="doc-aside-border">
								
						
									<div id="fixed-box" class="fixing-box"	style="">
										<div id="view-like-recom">
											<div id="__elm_view-like-recom__qk_1">
												<div class="mod page-doc-list relate-doc ">
													<b class="top"><b class="tl"></b><b class="tr"></b></b>
													<div class="inner">

														<div class="hd clearfix">
															
															<h4>
																相关文档推荐
															</h4>
														</div>
														<div class="bd">
															<div id="pageList-4-relate" 	class="tabContent relate_doc_list">
																
																
															
									
														  {volist name="tjdocconlist" id="vo"}
														  
														<div class="item">
																	<p class="doc-title">
																		<b class="ic ic-{$vo.ext}"></b>
																		<a class="ellipsis rec-items A-relate-doc logSend log-xsend" href="{:url('doc/doccon',array('id'=>$vo.id))}" target="_blank" title="{$vo.title}">{$vo.title}</a>
																	</p>
																	<div class="gd-g tail-info">
																		<div class="gd-g-u gd-u-3-8">
																			
																			{if condition="$vo['ratycount'] gt 0"}
																			<span title="{$vo.raty}分，{$vo['ratycount']}人评">
																			{php}$arr=getpingfen($vo['raty']);{/php}
																		
																			{volist name="arr" id="subvo"}
																			{if condition="$subvo eq 2"}
																			<b class="ic ic-star-s-on"></b>
																			{elseif condition="$subvo eq 1"}
																			<b class="ic ic-star-s-half"></b>
																			{else/}
																			<b class="ic ic-star-s-off"></b>
																			{/if}
																			{/volist}
																			
																			</span>
																			{else/}
																			暂无评价
																			{/if}
																			
																		</div>
																		<div class="gd-g-u gd-u-1-4">&nbsp;{$vo.pageid}页</div>
																		<div class="gd-g-u gd-u-3-8">&nbsp;&nbsp;{if condition="$vo['score'] gt 0"}{$vo['score']}{$pointname}{else/}免费{/if}</div>
																	</div>
																</div>
														  
																	
															{/volist}
																
																
																
															</div>
														</div>
													</div>
													<b class="bottom"><b class="bl"></b><b class="br"></b></b>
												</div>

											</div>
											<div class="mod page-doc-list other-like-doc ">
												
												<div class="inner">

													<div class="hd clearfix">
														<h4>喜欢此文档的还喜欢</h4>
													</div>
													<div class="bd">
														<div id="pageList-4" class="tabContent other_like_list" >
															
														  {volist name="likedocconlist" id="vo"}
																<div class="item">
																	<p class="doc-title">
																		<b class="ic ic-{$vo.ext}"></b>
																		<a class="ellipsis" href="{:url('doc/doccon',array('id'=>$vo.id))}" target="_blank" title="{$vo.title}">{$vo.title}</a>
																	</p>
																	<div class="gd-g tail-info">
																		<div class="gd-g-u gd-u-3-8">
																			
																			{if condition="$vo['ratycount'] gt 0"}
																			{php}$arr=getpingfen($vo['raty']);{/php}
																			<span title="{$vo.raty}分，{$vo['ratycount']}人评">
																			{volist name="arr" id="subvo"}
																			{if condition="$subvo eq 2"}
																			<b class="ic ic-star-s-on"></b>
																			{elseif condition="$subvo eq 1"}
																			<b class="ic ic-star-s-half"></b>
																			{else/}
																			<b class="ic ic-star-s-off"></b>
																			{/if}
																			
																		
																			{/volist}
																			
																			</span>
																			{else/}
																			暂无评价
																			{/if}
																			
																		</div>
																		<div class="gd-g-u gd-u-1-4">&nbsp;{$vo.pageid}页</div>
																		<div class="gd-g-u gd-u-3-8">&nbsp;&nbsp;{if condition="$vo['score'] gt 0"}{$vo['score']}{$pointname}{else/}免费{/if}</div>
																	</div>
																</div>
															{/volist}
															
														</div>
													</div>
												</div>
												<b class="bottom"><b class="bl"></b><b class="br"></b></b>
											</div>

										</div>
					
										<div class="zhixin-right"></div>
										<div class="fengchao-right"></div>
										<div class="comment mb20 mt20"></div>
									</div>
					
								</div>
							</div>

						</div>


					</div>
				</div>
			</div>

		</div>

	





		



		

		

		
	

	
</div>
	
	<div class="reader-tools-bar-wrap ugctest">
			<div class="reader-tools-bar" style="width: 1200px;">
				<div class="left">
				{if condition="$info['pageid'] gt 0"}
					<a class="ic reader-fullScreen xllDownloadLayerHit_left" href="javascript:;"  onclick="fulldoc();" title="全屏显示" ></a>
			{/if}
					<a class="ic reader-bookmark statusajaxbtn {if condition='$info.hassc eq 1'}active{/if}" title="收藏" data-id="{$info.id}" data-url="{:url('doc/docstatus')}"  data-type="3"></a>
					<div class="reader-tools-btn-wrap" tabindex="-1" hidefocus="true">
						<a class="ic reader-favo reader-favo-new statusajaxbtn {if condition='$info.haszan eq 1'}active{/if}"  title="赞" data-id="{$info.id}" data-url="{:url('doc/docstatus')}"  data-type="1"></a>
					</div>
					
					<div class="mod doc-evaluate" id="doc-evaluate-mod"
						style="display: block;">
						
						{if condition='$info.haspf eq 1'}
						<div class="content">
							<span class="evaluate-title">您已评价：</span>
							<span id="total-star"	class="star statusajaxbtn" data-id="{$info.id}" data-url="{:url('doc/docpingfen')}"  data-type="0" > 
							
							{volist name="info['pingfen']" id="vo"}
							{if condition="$vo eq 2"}
																		<b class="value-star total ic-star-t-on"></b>
																			{elseif condition="$vo eq 1"}
																			<b class="value-star total ic-star-t-half"></b>
																			{else/}
																		<b class="value-star total ic-star-t-off"></b>
																			{/if}
							
							
							{/volist}
						
						</span>
						<span	class="value-tip" id="doc-evaluate-tips"></span>
						</div>
						{else/}
						<div class="content" id="reader-evaluate-content-wrap" >
							<span class="evaluate-title">评价文档：</span>
							<span id="total-star"	class="star statusajaxbtn" data-id="{$info.id}" data-url="{:url('doc/docpingfen')}"  data-type="0" > 
							<b
						class="value-star total ic-star-t-off"></b><b
						class="value-star total ic-star-t-off"></b><b
						class="value-star total ic-star-t-off"></b><b
						class="value-star total ic-star-t-off"></b><b
						class="value-star total ic-star-t-off"></b></span>
						<span	class="value-tip" id="doc-evaluate-tips"></span>
						</div>
						
						
						
						
						{/if}
						
						<div class="value-pop">
							<span class="bot"></span><span class="top"></span>
							<p></p>
						</div>
					</div>
				</div>
				<div class="right"></div>
				
				<div class="center" >
					<div class="centerLeft">
					
						<div class="reader-tools-page xllDownloadLayerHit_left">
							{if condition="$info['pageid'] gt 0"}	<input type="text" class="page-input"  value="1"  />/<span class="page-count">{$info.pageid}</span>{/if}
						</div>
						<div class="reader-tools-btn-wrap-new download-btn">
							<span class="reader-download-price"><span
								class="ic download-price-ic"></span>{if condition="$info['score'] gt 0"}{$info['score']}{$pointname}{else/}免费{/if}</span>
								<a class="reader-download ui-bz-btn-senior" href="javascript:;" onclick="downtip();" ><i class="iconfont icon-shangchuan1"></i>下载</a>
								<span id="edit-docPrice" style="display: none;"></span>
						</div>
					</div>
					<div class="centerRight">
					{if condition="$hasrss eq 1"}
						<a href="javascript:void(0);" class="h-icon-base h-attention-btn leftbtnrss leftbtnhas" >
						<i class="iconfont icon-dingyue"></i> <span>已订阅</span></a>     
					{else/}
						<a href="javascript:void(0);" class="h-icon-base h-attention-btn leftbtnrss " >
						<i class="iconfont icon-dingyue"></i> <span>订阅该文档分类</span></a>     
					{/if}
					
						
					</div>
				</div>
				
				
				
			</div>
		</div>
		
		
		<div id="downtip" style="display:none">
	
		<div class="dialog-ad">  
		<div class="dialog-container need-wealth nonVipTNEWNE">
		<div class="close-btn"></div>
		<div class="dialog-left-greenbar"></div>
		<div class="dialog-top">    
		<p class="doc-title" rel="new-dialog" alt="dialog_tit">{$info.title}</p>    
		<p class="doc-size">（{$info.size|format_bytes}）</p></div>   
		<div class="dialog-inner tac">       
		<p class="ticket-num-msg msg1 coupon-need">所需{$pointname}：<b class="ml-5">{$info.score}</b></p>
		       <p class="ticket-detail-msg msg2">           
		       
		      
		         {if condition="is_login() gt 0"}
		          您持有：<span class="col-red">{$userinfo['point']}</span>{$pointname}&nbsp;   
		          {if condition="$info['hasdown'] eq 1"}
		               
		        <span class="ps">你可以免费下载该文档</span>
		          </p>       <p></p>       
		       <div class="blank20"></div>       
		       <div class="diaolog-downdoc text-center">
		       
		       <a class="btn btn-success downloadbtn"  href="{:url('File/downloadFile',array('id'=>encrypt($info['fileid']),'tid'=>encrypt($info['id'])))}">
		       <b class="ui-bz-btn-p-16 ui-bz-btc es-font18">免费下载</b></a>   
		        
		        {else/}
		       {if condition="$downstatus eq 0"}
		       <span class="ps">{$pointname}不足，无法下载</span>
		       {:hook('showpay')}
		       {/if}
		       </p>       <p></p>       
		       <div class="blank20"></div>       
		       <div class="diaolog-downdoc text-center">
		       {if condition="$downstatus eq 1"}
		       <a class="btn btn-success downloadbtn"  href="{:url('File/downloadFile',array('id'=>encrypt($info['fileid']),'tid'=>encrypt($info['id'])))}">
		       <b class="ui-bz-btn-p-16 ui-bz-btc es-font18">支付并下载</b></a>   
		        {/if}    
		        
		            {/if}    
		            
		            
		            
		            
		             {else/}
		            <a class="btn btn-success" href="{:url('user/login')}" target="_blank">请先登录或注册</a>
		            
		            {/if}    
		        
		       </div>  
		       
		       
		          </div>   
		             <div class="dialog-bottom">       
		           
		           
		                </div></div></div>
		</div>
		
		
{/block}
{block name="script"}
<script>
var layerindex;
var hasdown="{$info['hasdown']}";
var infoscore="{$info['score']}";
var infopageid="{$info['pageid']}";
var limitpage=2;
var full=0;
var layindex=0;

if(infoscore>0&&hasdown!=1){
$.post("{:url('doc/ajaxipstr')}",{id:"{$info['id']}",ext:"{$info['ext']}",filename:"{$info['fileinfo'][0]}",num:2,type:1},function(data){
	
	var html=$.parseJSON(data);
	
	console.log(html);
	$('#reader-container-inner-1').append(html.str);
	showpage();
});
}else{
	$.post("{:url('doc/ajaxipstr')}",{id:"{$info['id']}",ext:"{$info['ext']}",filename:"{$info['fileinfo'][0]}",num:2,type:2},function(data){
		
		
		var html=$.parseJSON(data);
		
		$('#reader-container-inner-1').append(html.str);
		showpage();
	});
	
}


function fulldoc(){
	
	var index = layer.open({
		title: false,
		
		 closeBtn: 0,
		  type: 2,
		  area:['auto','auto'],
		  content: "{:url('doc/fulldoc',array('id'=>$info['id']))}",
		  success: function(layero, index){
			 
			  full=1;
			  }//这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
		});
	  layer.full(index);
}
function downtip(){
	
	layer.open({
		title: false,
		closeBtn: 0,
		  type: 1,
		  area:['auto','auto'],
		  success: function(layero){
		layindex=layero;
			    layer.setTop(layero); //重点2
			  },
		  content: $('#downtip') //这里content是一个DOM，注意：最好该元素要存放在body最外层，否则可能被其它的相对元素所影响
		});
	
	
}
window.onload = function() {  


	
};
function showpage(){
	
	//如果大于2页，显示
	if(infopageid>limitpage){
		
		$('#endtishi').addClass('hide');
		$('#shengtishi').removeClass('hide');
		var page = parseInt($('.page-count').html());
		$('#shengpage').html(page-2);

		
	}
		



		
		
		$(window).resize(function(){
			layer.style(layerindex, {
				  width: $(window).width(),
				  height: $(window).height()
				}); 
			});
		
		
		
		if(infopageid>0){
			$(window).scroll(function() {
				
				var offsettop=$('.stl_02').eq(0).offset().top;
				var stheight=$('.stl_02').eq(0).outerHeight();
				
				var scrolltop=$(this).scrollTop();
				
				var pageid=Math.ceil((scrolltop-offsettop)/stheight);
				
				var page = parseInt($('.page-count').html());
				
				if(pageid<1){
					pageid=1;
				}
				if(pageid>page){
					
					
					
					pageid=page;
				}
				$('.page-input').val(pageid);
				
				if(infopageid>limitpage){
					
					
					
					
					if(pageid>=page){
						$('#endtishi').removeClass('hide');
						$('#shengtishi').addClass('hide');
					}else{
						$('#shengpage').html(page-pageid);
					}
					
					
				}else{
					
					
				}
				
				
				
				
				
				if(infoscore>0&&hasdown!=1){
					
					
					
						
						
						
					}else{
						
						$('.stl_02').eq(pageid).removeClass('hide');
						
						
					}
				
				
				
			});
			
			var fpageid=Math.ceil(($(window).scrollTop()-$('.stl_02').eq(0).offset().top)/($('.stl_02').eq(0).outerHeight()));
			var fpage = parseInt($('.page-count').html());
			
			if(fpageid<1){
				fpageid=1;
			}
			if(fpageid>fpage){
				fpageid=fpage;
			}
			
			$('.page-input').val(fpageid);
			
			
			$('.page-input').keydown(function(e) {
				if (e.which === 13) {
					
					var keypageid = $('.page-input').val();
					
					var keypage = parseInt($('.page-count').html());
					
					if(keypageid<1){
						keypageid=1;
					}
					if(infoscore>0&&hasdown!=1){
						
							keypageid=limitpage;
						
						
					}else{
						if(keypageid>keypage){
							keypageid=keypage;
						}
					}
				

					$(window).scrollTop($('.reader-page-'+keypageid).offset().top);
					
					return false;
				}
			});
		}
	
	
}
$(function(){

	$('.reply-btn').click(function(){

		var id=$(this).data('id');
		
		var name=$(this).data('name');

		$('#commenttid').val(id);
        var html=$('.post-comment-ipt').val();
		$('.post-comment-ipt').html('@'+name+':');


		});
	

	
	$('.add-new-btn').click(function(){
		
	    $.post($('form#commentform').data('url'),$('form#commentform').serialize(),function(data){
	    	
		      if(data.code == 1){
		       
		        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
		          location.reload();
		        });
		      }else{
		      
		        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
		       
		        
		      }
		    });
		    return false;
		
	});
	 $('.leftbtnrss').click(function(){
		 
		  
		 if($(this).hasClass('leftbtnhas')){
			 
			    $.post("{:url('user/rsscate')}",{cateid:"{$info['tid']}",type:2},function(data){
			    	
				      if(data.code == 1){
				        
				        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
				        	 $('.leftbtnrss').find('span').html('订阅该文档分类');
							 $('.leftbtnrss').removeClass('leftbtnhas');
				        });
				      }else{
				        
				        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
				        
				        
				        
				      }
				    });
			 
			 
			 
		 }else{
			 
			    $.post("{:url('user/rsscate')}",{cateid:"{$info['tid']}",type:1},function(data){
			    	
				      if(data.code == 1){
				     
				        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
				        	$('.leftbtnrss').find('span').html('已订阅');
							 $('.leftbtnrss').addClass('leftbtnhas');
				        });
				      }else{
				       
				        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
				        
				        
				        
				      }
				    });
			
			
		 }
		 
		
	 });
$('.leftbtnrss').hover(function(){
	
	 if($(this).hasClass('leftbtnhas')){
		 
		 $('.leftbtnrss').find('span').html('取消订阅');
		 
	 }
		 
		
	 },function(){
		 if($(this).hasClass('leftbtnhas')){
			 $('.leftbtnrss').find('span').html('已订阅');
		 }
		 
	 });
	
});
</script>
{/block}